import {
  addcustomer,
  sendtemplatemessage,
  addcompany_bc,
  addcompany_tax,
  month_charge,
  chief_refuse,
  chief_agree,
  account_repair,
  editcustomer,
  addonestopservice,
  editonestopservice,
  addvoucher,
  editvoucher,
  deletevoucher,
  refusevoucher,
  reviewvoucher,
  vouchercomplete,

} from '@/services/customer';

const UserModel = {
  namespace: 'customer',
  state: {
    currentUser: {},
  },
  effects: {
    *sendtemplatemessage({ payload }, { call, put }) {
      const response = yield call(sendtemplatemessage, payload);
      return response
    },
    *chief_agree({ payload }, { call, put }) {
      const response = yield call(chief_agree, payload);
      return response
    },
    *chief_refuse({ payload }, { call, put }) {
      const response = yield call(chief_refuse, payload);
      return response
    },

    *addcustomer({ payload }, { call, put }) {
      const response = yield call(addcustomer, payload);
      return response
    },
    *addcompany_tax({ payload }, { call, put }) {
      const response = yield call(addcompany_tax, payload);
      return response
    },
    *account_repair({ payload }, { call, put }) {
      const response = yield call(account_repair, payload);
      return response
    },
    *addcompany_bc({ payload }, { call, put }) {
      const response = yield call(addcompany_bc, payload);
      return response
    },
    *month_charge({ payload }, { call, put }) {
      const response = yield call(month_charge, payload);
      return response
    },
    *editcustomer({ payload }, { call, put }) {
      const response = yield call(editcustomer, payload);
      return response
    },
    *addonestopservice({ payload }, { call, put }) {
      const response = yield call(addonestopservice, payload);
      return response
    },
    *editonestopservice({ payload }, { call, put }) {
      const response = yield call(editonestopservice, payload);
      return response
    },
    *addvoucher({ payload }, { call, put }) {
      const response = yield call(addvoucher, payload);
      return response
    },
    *editvoucher({ payload }, { call, put }) {
      const response = yield call(editvoucher, payload);
      return response
    },
    *deletevoucher({ payload }, { call, put }) {
      const response = yield call(deletevoucher, payload);
      return response
    },
    *refusevoucher({ payload }, { call, put }) {
      const response = yield call(refusevoucher, payload);
      return response
    },
    *reviewvoucher({ payload }, { call, put }) {
      const response = yield call(reviewvoucher, payload);
      return response
    },
    *vouchercomplete({ payload }, { call, put }) {
      const response = yield call(vouchercomplete, payload);
      return response
    },

  },
  reducers: {
    saveCurrentUser(state, action) {
      return { ...state, ...action.payload };
    }
  },
};
export default UserModel;
